package com.ryskoo.common.hclconstant;

/**
 * 优惠券获取方式
 * @author BeHappy
 */
public enum CouponObtainTypeEnum {
    ONLINE(1, "前台领取"),
    OFFLINE(2, "后台发放");
	
    private int value;
    private String name;

    CouponObtainTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(int value) {
        for (CouponObtainTypeEnum o : CouponObtainTypeEnum.values()) {
            if (o.getValue() == value) {
                return o.getName();
            }
        }
        return "";
    }
}
